﻿class QNService {


    public static getFullUrl(_url: string): string {
        var url: string = _url;
        if (url.indexOf("http") >= 0) {
            //url = _url;
        } else {
            url = VO.FILESERVER_HOST + url;
        }

        if (url.indexOf(VO.AUDIO_NAME_AMR) >= 0) {
            url += VO.AUDIO_MP3;
        }

        if (url.indexOf(VO.VIDEO_NAME_MP4) >= 0) {
            url += VO.VIDEO_ADDON;
        }

        return url;
    }

    public static checktype(dataurl: string, audio: string): string {
        var _type: string = "图片";
        if (audio)
            _type = "故事";
        if (dataurl) {
            if (dataurl.indexOf(VO.ANIME_DATA_NAME) >= 0)
                _type = "动画";
            else if (dataurl.indexOf(VO.QUIZ_DATA_NAME) >= 0)
                _type = "问答";
            else if (dataurl.indexOf(VO.VIDEO_NAME_MP4) >= 0)
                _type = "视频";
        }
        return _type;
    }
} 